﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:WP8.VisualStates.Controls">

    <Style TargetType="controls:MiControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="MyVisualStateGroup">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:5" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="LeftButton">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="unicornioRosa" Storyboard.TargetProperty="(Fill).(SolidColorBrush.Color)" From="Pink" To="SkyBlue" Duration="0:0:0"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <StackPanel>
                            <Rectangle x:Name="unicornioRosa" Height="300" Width="300" Fill="Pink" />
                            <Button x:Name="btn" Content="Go!" VerticalAlignment="Bottom" />
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>